<title>部门设定</title>

<div class="page-header">
	<h1>
		基本信息管理 <small> <i class="ace-icon fa fa-angle-double-right"></i>
			部门设定
		</small>
	</h1>
</div>

<div class="holyContainer">
	<div class="row">
		<div class="col-xs-12">
			<div class="widget-box">
				<div class="widget-header">
					<h4 class="widget-title">查询条件</h4>
					<span class="widget-toolbar"> <a
						class="btn btn-primary btn-xs  dep_search_btn">搜索</a> <a
						class="btn btn-xs" onclick="$('#report-search-form')[0].reset()">重置</a>
					</span>
				</div>
				<div class="widget-body" style="display: block;">
					<div class="widget-main">
						<form role="search" method="get" id="report-search-form">
							<div class="row">
								<div class="col-xs-12 col-sm-12 col-lg-8 col-lg-push-2">
									<label for="dateRange">部门编号</label>
									<div class="input-group">
										<span class="input-group-addon"> <i
											class="fa fa-check-square-o bigger-110"></i>
										</span> <input class="form-control text-center search_dep_no"
											type="text" name="dep_no" id="" dep_no""/>
									</div>
									<div class="hr hr8"></div>
								</div>
							</div>

							<div class="row">
								<div class="col-sm-6 col-lg-4 col-lg-push-2">
									<label for="projectSelect">名称</label>
									<div class="input-group">
										<input class="form-control search_dep_name" type="text"
											id="dep_name" name="dep_name"> <span
											class="input-group-btn">
											<button class="btn btn-sm btn-default select_age_btn"
												type="button">
												<i class="ace-icon fa fa-calendar bigger-110"></i> Select!
											</button>
										</span>
									</div>
									<div class="hr hr8"></div>
								</div>
								<div class="col-sm-6 col-lg-4 col-lg-push-2">
									<label for="phoneSearch">类型</label> <select id="dep_type"
										name="dep_type" class="form-control search_dep_type">
										<option value="-1" selected>所有</option>
										<option value="0">公司</option>
										<option value="1">部门</option>
									</select>
									<div class="hr hr8"></div>
								</div>
							</div>
						</form>
					</div>
				</div>

			</div>
		</div>
	</div>


	<div class="row main_container">
		<div class="col-xs-12">
			<!-- PAGE CONTENT BEGINS -->
			<div class="row">
				<div class="col-sm-12 dep_list">
					<div class="widget-box">
						<div class="widget-header">
							<h4 class="widget-title lighter smaller">部门列表</h4>
						</div>
						<div class="widget-body">
							<div class="widget-main padding-8">
								<ul id="department-treeview"></ul>
							</div>
						</div>
					</div>
				</div>
				<div class="col-sm-6 dep_info_area">
					<div class="widget-box ">
						<div class="widget-header">
							<h4 class="widget-title lighter smaller">部门详细信息</h4>
							<span class="widget-toolbar"> <a href="#"
								data-action="settings"> <i class="ace-icon fa fa-cog"></i>
							</a> <a href="#" data-action="reload"> <i
									class="ace-icon fa fa-refresh"></i>
							</a> <a href="#" data-action="collapse"> <i
									class="ace-icon fa fa-chevron-up"></i>
							</a>
							</span>
						</div>
						<div class="widget-body">
							<div class="widget-main">
								<!-- ajax -->
								<form class="add_dep_form">
									<div class="row">
										<div class="col-sm-4">
											<div class="form-group">
												<label class="control-label" for="form-field-1">编号</label> 
												<input type="text" class="form-control dep_no" value="" disabled/>
											</div>
										</div>
										<div class="col-sm-4">
											<div class="form-group">
												<label class="control-label" for="form-field-1">名称</label> 
												<input type="text" class="form-control dep_name" value="" readonly />
											</div>
										</div>
										<div class="col-sm-4">
											<div class="form-group">
												<label class="control-label" for="form-field-1">类型</label> <input
													type="text" id="form-field-1" placeholder=""
													class="form-control dep_type" value="" readonly />
											</div>
										</div>
									</div>
									<div class="row">
										<div class="col-sm-4">
											<div class="form-group">
												<label class="control-label" for="form-field-1">电话</label> <input
													type="text" id="form-field-1" placeholder=""
													class="form-control dep_phone" value="" readonly />
											</div>
										</div>
										<div class="col-xs-4">
											<label class="control-label" for="form-field-1">传真</label> <input
												type="text" id="form-field-1" placeholder=""
												class="form-control dep_tax" value="" readonly />
										</div>
										<div class="col-xs-4">
											<label class="control-label" for="form-field-1">描述</label> <input
												type="text" id="form-field-1" placeholder=""
												class="form-control dep_desc" value="" readonly />
										</div>
									</div>
									<div class="row">
										<div class="col-sm-6">
											<div class="form-group">
												<label class="control-label" for="form-field-1">上级部门</label>
												<input type="text" id="form-field-1" placeholder=""
													class="form-control dep_parent_name" value="" readonly />
											</div>
										</div>
										<div class="col-xs-6">
											<label class="control-label" for="form-field-1">成立日期</label>
											<input type="text" id="form-field-1" placeholder=""
												class="form-control dep_create_time" value="" readonly />
										</div>
									</div>
									<hr />
									<div class="row col-xs-12">
										<span class="widget-toolbar">
											<a class="btn btn-primary btn-xs dep_view_emp_btn">员工</a> 
											<a class="btn btn-primary btn-xs dep_add_btn">添加</a> 
											<a class="btn btn-primary btn-xs dep_update_btn">更新</a> 
											<a class="btn btn-primary btn-xs dep_delete_btn">删除</a>
										</span>
									</div>
									<div class="alert_container row col-xs-6"></div>
									<hr />
									<hr />

									<div class="row">
										<di class="col-xs-12"> <!-- TODO --> 子部门
										<table id="menu-management-table"
											class="table table-striped table-bordered table-hover">
											<thead>
												<tr>
													<th>编号</th>
													<th>名称</th>
													<th>备注</th>
													<th>操作</th>
												</tr>
											</thead>

											<tbody class="sub_parent_list">
											</tbody>
										</table>
										<!-- TODO add buttons, add fucking js--> <em>所有部门名称不能重复,这里应该还有一些按钮。对checkbox进行操作</em>
										</di>
									</div>
								</form>
							</div>
						</div>
					</div>
					<hr />

				</div>
			</div>

			<!-- /section:plugins/fuelux.treeview -->
			<script type="text/javascript">
				var $assets = "lib/assets";//this will be used in fuelux.tree-sampledata.js
			</script>
		</div>

		<div class="modal fade dep_add_modal" id="modal" tabindex="-1"
			role="dialog">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title">添加部门</h4>
					</div>
					<div class="modal-body">
						<form class="add_dep_form">
							<div class="row">
								<div class="col-sm-4">
									<div class="form-group">
										<label class="control-label" for="form-field-1">编号</label> 
										<input type="text" name="dep_add_no" class="form-control dep_add_no" value="" disabled/>
									</div>
								</div>
								<div class="col-sm-4">
									<div class="form-group">
										<label class="control-label" for="form-field-1">名称</label> 
										<input
											type="text" name="dep_add_name" placeholder=""
											class="form-control dep_add_name" value="" />
									</div>
								</div>
								<div class="col-sm-4">
									<div class="form-group">
										<label class="control-label" for="form-field-1">类型</label> 
										<select
											id="form-field-1" class="form-control dep_add_type">
											<option value="公司" class="gongsi" selected>公司</option>
											<option value="部门" class="bumen">部门</option>
										</select>
									</div>
								</div>
							</div>
							<div class="row">
								<div class="col-sm-4">
									<div class="form-group">
										<label class="control-label" for="form-field-1">电话</label>
										<input
											type="text" name="dep_add_phone" placeholder=""
											class="form-control dep_add_phone" value="" />
									</div>
								</div>
								<div class="col-xs-4">
									<label class="control-label" for="form-field-1">传真</label> <input
										type="text" id="form-field-1" placeholder=""
										class="form-control dep_add_tax" value="" />
								</div>
								<div class="col-xs-4">
									<label class="control-label" for="form-field-1">描述</label> <input
										type="text" id="form-field-1" placeholder=""
										class="form-control dep_add_desc" value="" />
								</div>
							</div>
							<div class="row">
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label" for="form-field-1">上级部门</label> <input
											type="text" id="form-field-1" placeholder=""
											class="form-control dep_add_parent_name" value="" disabled/>
									</div>
								</div>
								<div class="col-xs-6">
									<label class="control-label" for="form-field-1">成立日期</label>
									<div class="input-group">
										<span class="input-group-addon"> <i
											class="fa fa-calendar bigger-110"></i>
										</span>
										<input type="text" name="dep_add_create_time" placeholder=""
											class="form-control dep_add_create_time date-picker" value=""
											data-date-format="yyyy-mm-dd" readonly>
									</div>
								</div>
							</div>
							<hr />
							<div class="alert_container row col-xs-6"></div>
						</form>
					</div>
					<div class="modal-footer">
					 	<input class="submit btn btn-xs dep_add_submit_btn" type="submit" value="添加">
						<input type="button" class="btn btn-default"
							data-dismiss="modal" value="关闭">
					</div>
				</div>
			</div>
		</div>

		<div class="modal fade dep_update_modal" id="modal" tabindex="-1"
			role="dialog">
			<div class="modal-dialog" role="document">
				<form class="update_dep_form" id="update_dep_form">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">更新部门信息</h4>
						</div>
						<div class="modal-body">
							<div class="row">
								<div class="col-sm-4">
									<div class="form-group">
										<label class="control-label" for="form-field-1">编号</label> 
										<input type="text" class="form-control update_dep_no" value="" disabled/>
									</div>
								</div>
								<div class="col-sm-4">
									<div class="form-group">
										<label class="control-label" for="form-field-1">名称</label> <input
											type="text" id="form-field-1" placeholder=""
											class="form-control update_dep_name" value="" />
									</div>
								</div>
								<div class="col-sm-4">
									<div class="form-group">
										<label class="control-label" for="form-field-1">类型</label> <select
											id="form-field-1" class="form-control update_dep_type">
											<option value="公司">公司</option>
											<option value="部门">部门</option>
										</select>
									</div>
								</div>
							</div>
							<div class="row">
								<div class="col-sm-4">
									<div class="form-group">
										<label class="control-label" for="form-field-1">电话</label> <input
											type="text" id="form-field-1" placeholder=""
											class="form-control update_dep_phone" value="" />
									</div>
								</div>
								<div class="col-xs-4">
									<label class="control-label" for="form-field-1">传真</label> <input
										type="text" id="form-field-1" placeholder=""
										class="form-control update_dep_tax" value="" />
								</div>
								<div class="col-xs-4">
									<label class="control-label" for="form-field-1">描述</label> <input
										type="text" id="form-field-1" placeholder=""
										class="form-control update_dep_desc" value="" />
								</div>
							</div>
							<div class="row">
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label" for="form-field-1">上级部门</label> <input
											type="text" id="form-field-1" placeholder=""
											class="form-control update_dep_parent_name" value="" disabled />
									</div>
								</div>
								<div class="col-xs-6">
									<label class="control-label" for="form-field-1">成立日期</label>
									<div class="input-group">
										<span class="input-group-addon"> <i
											class="fa fa-calendar bigger-110"></i>
										</span> <input type="text" id="form-field-1" placeholder=""
											class="form-control update_dep_create_time date-picker"
											value="" data-date-format="yyyy-mm-dd" readonly />
									</div>
								</div>
							</div>
							<hr />
							<div class="alert_container row col-xs-6"></div>
						</div>
						<div class="modal-footer">
							<input type="button"
								class="btn btn-success dep_update_submit_btn" value="更新"
								data-dismiss="modal"> <input type="button"
								class="btn btn-default" data-dismiss="modal" value="关闭">
						</div>
					</div>
				</form>
			</div>
		</div>

		<div class="modal fade dep_delete_modal" id="modal" tabindex="-1"
			role="dialog">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title">删除部门信息</h4>
					</div>
					<div class="modal-body">
						<div class="alert alert-danger">
							<strong> <i class="ace-icon fa fa-times"></i>
							</strong> 确认删除<br>
						</div>
					</div>
					<div class="modal-footer">
						<input type="button" class="btn btn-success dep_delete_submit_btn" data-dismiss="modal" value="删除"> 
						<input type="button"
							class="btn btn-default" data-dismiss="modal" value="关闭">
					</div>
				</div>
			</div>
		</div>
		
		<div class="modal fade dep_emp_view_modal" id="modal" tabindex="-1"
			role="dialog">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title">员工信息</h4>
					</div>
					<div class="modal-body">
						<!-- result table -->
						<div class="row search_table">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<div class="row">
									<div class="col-xs-12">
										<table id="simple-table"
											class="table table-striped table-bordered table-hover">
											<thead>
												<tr>
													<th>姓名</th>
													<th><i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>职位</th>
													<th>类型</th>
												</tr>
											</thead>
											<tbody class="emp_search_container">
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
						<!-- end of result table -->
					</div>
					<div class="modal-footer">
						<input type="button" class="btn btn-default" data-dismiss="modal" value="关闭">
					</div>
				</div>
			</div>
		</div>

		<div class="modal fade alert_modal" id="modal" tabindex="-1"
			role="dialog">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-body">
						<div class="alert alert-danger alert_info">
							<strong> <i class="ace-icon fa fa-times"></i>
							</strong>没有搜索结果<br>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>
</div>

<script type="text/javascript">
	var scripts = [ null, null, null ]
	$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
		jQuery(function($) {
			$(".date-picker").datepicker({
				autoclose : true,
				todayHighlight : true,
				endDate : "0d"
			})
			//show datepicker when clicking on the icon
			.next().on(ace.click_event, function() {
				$(this).prev().focus();
			});
		});
	});
</script>

<script src="plugin/validate/jquery.validate.min.js"></script>
<script src="plugin/sim/sim.tree.js"></script>
<script src="resources/youxiao/js/dep.manage.js"></script>